﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;

/// <summary>
/// Summary description for VacancyMethord
/// </summary>
public class VacancyMethord
{
    public SqlDataReader VacancySearch(string _title)
	{

        SqlDataReader sqldr = null;
        SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);
        if (sqlcon.State == System.Data.ConnectionState.Closed) {
            sqlcon.Open();
        }

        SqlCommand sqlcmm = new SqlCommand("SELECT Title,[Description],NumberOfJob,Salary,Workplace,DateFulfilled FROM tb_Vacancy WHERE Title = @title  ", sqlcon);
        sqlcmm.Parameters.AddWithValue("@title", _title);
        sqldr = sqlcmm.ExecuteReader();
        return sqldr;
	}
    
}